var rlTime = 10000;

function updateRoomList() {
  $.ajax({
    url: '/room/list',
    type: 'GET',
    success: function(data, textStatus) {
      $("#rooms").html(data);
      setTimeout("updateRoomList()", rlTime);
    }
  });
}

$(document).ready(function() {
  updateRoomList();
  updateUserList();
});

function updateUserList() {
  $.ajax({
    url: '/user/online',
    type: 'GET',
    success: function(data, textStatus) {
      $("#users").html(data);
      setTimeout("updateUserList()", rlTime);
    }
  });
}